
<script type="text/javascript" src="@{'/public/javascripts/jquery-1.6.4.min.js'}"></script>
<script type="text/javascript">
function lan(aaa){
        $.ajax({
               type:"POST",
               url:"@{test()}",
               dataType:"json",
               data:"id="+$(aaa).val(),
               success:function(data){
               if(data[0].id != "non"){
                   var opt = "";
	               for(var i=0;i<data.length;i++){
	                  if(opt == ""){
	                    opt = "<option value="+data[i].id+">"+data[i].proName+"</option>";
	                  }else{
	                    opt += "<option value="+data[i].id+">"+data[i].proName+"</option>";
	                  }
	               }
	                 $(aaa).nextAll().remove();
	                 $(aaa).after("&nbsp;&nbsp;<select name='parId' onchange='lan(this);'><option>请选择：</option>"+opt+"</select>");
               }else{
                     $(aaa).nextAll().remove();
               }
               }
        });
 }
</script>

<form action="@{save()}" method="post">
     #{if flash.success}
    <p><font color="red">${flash.success}</font></p>
     #{/if}
	<p>更改父栏目：
	<select name="parId" onchange="lan(this);">
	        #{if programa.pro}
		     <option value=${programa.pro?.id}>${programa.pro?.proName}</option>
		     <option value="0">顶级栏目</option>
	        #{/if}
	        #{else}
		     <option value="0">顶级栏目</option>
	        #{/else}
			#{list items:programas,as:'progra'}
			 #{if progra.id != programa.id}
			  <option value=${progra.id}>${progra.proName}</option>
			 #{/if}
			#{/list}
		</select>
	</p>
	<p>栏目名称：<input type="text" name="programa.proName" value=${programa.proName}>
	           <input type="hidden" name="programa.id" value=${programa.id}>
	</p>
	<p>信息代码：<input type="text" name="programa.proCode" value=${programa.proCode}></p>
	<p><input type="submit" value="更新"></p>
</form>